/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ChArFaTo
 */
@Entity
@Table(name = "docente", catalog = "proyectosw", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DocenteEJB.findAll", query = "SELECT d FROM DocenteEJB d"),
    @NamedQuery(name = "DocenteEJB.findByDTarjetaProfesional", query = "SELECT d FROM DocenteEJB d WHERE d.dTarjetaProfesional = :dTarjetaProfesional"),
    @NamedQuery(name = "DocenteEJB.findByDTipoVinculacion", query = "SELECT d FROM DocenteEJB d WHERE d.dTipoVinculacion = :dTipoVinculacion"),
    @NamedQuery(name = "DocenteEJB.findByDEstudio", query = "SELECT d FROM DocenteEJB d WHERE d.dEstudio = :dEstudio"),
    @NamedQuery(name = "DocenteEJB.findByDEstado", query = "SELECT d FROM DocenteEJB d WHERE d.dEstado = :dEstado")})
public class DocenteEJB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer dTarjetaProfesional;
    @Size(max = 255)
    @Column(length = 255)
    private String dTipoVinculacion;
    @Size(max = 255)
    @Column(length = 255)
    private String dEstudio;
    @Basic(optional = false)
    @NotNull
    @Column(nullable = false)
    private boolean dEstado;
    @OneToMany(mappedBy = "docenteDTarjetaProfesional")
    private Collection<GrupoEJB> grupoEJBCollection;
    @OneToMany(mappedBy = "docenteDTarjetaProfesional")
    private Collection<SalarioEJB> salarioEJBCollection;
    @JoinColumn(name = "PersonaPIdentificacion", referencedColumnName = "PIdentificacion")
    @ManyToOne
    private PersonaEJB personaPIdentificacion;

    public DocenteEJB() {
    }

    public DocenteEJB(Integer dTarjetaProfesional) {
        this.dTarjetaProfesional = dTarjetaProfesional;
    }

    public DocenteEJB(Integer dTarjetaProfesional, boolean dEstado) {
        this.dTarjetaProfesional = dTarjetaProfesional;
        this.dEstado = dEstado;
    }

    public Integer getDTarjetaProfesional() {
        return dTarjetaProfesional;
    }

    public void setDTarjetaProfesional(Integer dTarjetaProfesional) {
        this.dTarjetaProfesional = dTarjetaProfesional;
    }

    public String getDTipoVinculacion() {
        return dTipoVinculacion;
    }

    public void setDTipoVinculacion(String dTipoVinculacion) {
        this.dTipoVinculacion = dTipoVinculacion;
    }

    public String getDEstudio() {
        return dEstudio;
    }

    public void setDEstudio(String dEstudio) {
        this.dEstudio = dEstudio;
    }

    public boolean getDEstado() {
        return dEstado;
    }

    public void setDEstado(boolean dEstado) {
        this.dEstado = dEstado;
    }

    @XmlTransient
    public Collection<GrupoEJB> getGrupoEJBCollection() {
        return grupoEJBCollection;
    }

    public void setGrupoEJBCollection(Collection<GrupoEJB> grupoEJBCollection) {
        this.grupoEJBCollection = grupoEJBCollection;
    }

    @XmlTransient
    public Collection<SalarioEJB> getSalarioEJBCollection() {
        return salarioEJBCollection;
    }

    public void setSalarioEJBCollection(Collection<SalarioEJB> salarioEJBCollection) {
        this.salarioEJBCollection = salarioEJBCollection;
    }

    public PersonaEJB getPersonaPIdentificacion() {
        return personaPIdentificacion;
    }

    public void setPersonaPIdentificacion(PersonaEJB personaPIdentificacion) {
        this.personaPIdentificacion = personaPIdentificacion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dTarjetaProfesional != null ? dTarjetaProfesional.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DocenteEJB)) {
            return false;
        }
        DocenteEJB other = (DocenteEJB) object;
        if ((this.dTarjetaProfesional == null && other.dTarjetaProfesional != null) || (this.dTarjetaProfesional != null && !this.dTarjetaProfesional.equals(other.dTarjetaProfesional))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Modelo.DocenteEJB[ dTarjetaProfesional=" + dTarjetaProfesional + " ]";
    }
    
}
